#pragma once

/**
 * \class CMeshHierarchy
 * \brief This class defines a number of callbacks required by the D3DXLoadMeshHierarchyFromX function.
 * The required functions are defined by the abstract interface class: ID3DXAllocateHierarchy
 * \author Keith Ditchburn \date 17 July 2005
*/
class CMeshHierarchy : public ID3DXAllocateHierarchy
{
public:	
    // callback to create a D3DXFRAME extended object and initialize it
    STDMETHOD( CreateFrame )( THIS_ LPCSTR Name, LPD3DXFRAME *ppNewFrame );

    // callback to create a D3DXMESHCONTAINER extended object and initialize it
    STDMETHOD( CreateMeshContainer )( THIS_ LPCSTR Name, CONST D3DXMESHDATA * pMeshData, 
                            CONST D3DXMATERIAL * pMaterials, CONST D3DXEFFECTINSTANCE * pEffectInstances,
                            DWORD NumMaterials, CONST DWORD * pAdjacency, LPD3DXSKININFO pSkinInfo, 
                            LPD3DXMESHCONTAINER * ppNewMeshContainer );

    // callback to release a D3DXFRAME extended object
    STDMETHOD( DestroyFrame )( THIS_ LPD3DXFRAME pFrameToFree );

    // callback to release a D3DXMESHCONTAINER extended object
    STDMETHOD( DestroyMeshContainer )( THIS_ LPD3DXMESHCONTAINER pMeshContainerToFree );
};